namespace Lzfy_Refund_Service.Models
{
    /// <summary>
    /// 通用ID请求
    /// </summary>
    public class GetByIdRequest
    {
        public int Id { get; set; }
    }

    /// <summary>
    /// 关联ID请求
    /// </summary>
    public class GetByRelIdRequest
    {
        public string RelId { get; set; } = string.Empty;
    }

    /// <summary>
    /// 患者ID请求
    /// </summary>
    public class GetByPatientIdRequest
    {
        public string PatientId { get; set; } = string.Empty;
    }

    /// <summary>
    /// 患者ID和日期范围请求
    /// </summary>
    public class GetByPatientIdAndDateRangeRequest
    {
        public string PatientId { get; set; } = string.Empty;
        public int Days { get; set; }
    }

    /// <summary>
    /// 字典ID请求
    /// </summary>
    public class GetByDictIdRequest
    {
        public int DictId { get; set; }
    }

    /// <summary>
    /// 文件下载请求
    /// </summary>
    public class DownloadFileRequest
    {
        public string FileId { get; set; } = string.Empty;
    }

    /// <summary>
    /// 根据路径获取文件请求
    /// </summary>
    public class GetFileByPathRequest
    {
        public string Path { get; set; } = string.Empty;
    }

    /// <summary>
    /// Base64文件上传请求
    /// </summary>
    public class UploadBase64FileRequest
    {
        /// <summary>
        /// 患者ID
        /// </summary>
        public string PatientId { get; set; } = string.Empty;

        /// <summary>
        /// 文件名
        /// </summary>
        public string FileName { get; set; } = string.Empty;

        /// <summary>
        /// Base64编码的文件内容
        /// </summary>
        public string FileContent { get; set; } = string.Empty;
    }

    /// <summary>
    /// Base64文件下载请求
    /// </summary>
    public class DownloadBase64FileRequest
    {
        /// <summary>
        /// 文件ID
        /// </summary>
        public string FileId { get; set; } = string.Empty;
    }

    /// <summary>
    /// 根据路径获取Base64文件请求
    /// </summary>
    public class GetBase64FileByPathRequest
    {
        /// <summary>
        /// 文件相对路径
        /// </summary>
        public string Path { get; set; } = string.Empty;
    }

    /// <summary>
    /// 获取患者信息请求
    /// </summary>
    public class GetPatientInfoRequest
    {
        public string PatientId { get; set; } = string.Empty;
    }

    /// <summary>
    /// 统计查询请求
    /// </summary>
    public class StatisticsQueryRequest
    {
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 审核状态 (0=待审核, 1=审核通过, 2=审核失败)
        /// </summary>
        public int? AuditStatus { get; set; }

        /// <summary>
        /// 申请人类型 (self=本人申请, proxy=代办人申请)
        /// </summary>
        public string? ApplicantType { get; set; }

        /// <summary>
        /// 患者ID（可选）
        /// </summary>
        public string? PatientId { get; set; }

        /// <summary>
        /// 患者姓名（可选）
        /// </summary>
        public string? PatientName { get; set; }

        /// <summary>
        /// 银行卡持有人（可选）
        /// </summary>
        public string? BankCardHolder { get; set; }

        /// <summary>
        /// 页码（默认1）
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小（默认20）
        /// </summary>
        public int PageSize { get; set; } = 20;
    }

    /// <summary>
    /// 统计查询响应
    /// </summary>
    public class StatisticsQueryResponse
    {
        /// <summary>
        /// 数据列表
        /// </summary>
        public IEnumerable<RefundResponse> Data { get; set; } = new List<RefundResponse>();

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 统计概览
        /// </summary>
        public StatisticsSummary Summary { get; set; } = new StatisticsSummary();
    }

    /// <summary>
    /// 统计概览
    /// </summary>
    public class StatisticsSummary
    {
        /// <summary>
        /// 总申请数
        /// </summary>
        public int TotalApplications { get; set; }

        /// <summary>
        /// 审核通过数
        /// </summary>
        public int ApprovedCount { get; set; }

        /// <summary>
        /// 审核失败数
        /// </summary>
        public int RejectedCount { get; set; }

        /// <summary>
        /// 待审核数
        /// </summary>
        public int PendingCount { get; set; }

        /// <summary>
        /// 总退款金额
        /// </summary>
        public decimal TotalRefundAmount { get; set; }

        /// <summary>
        /// 通过的退款金额
        /// </summary>
        public decimal ApprovedRefundAmount { get; set; }
    }

    /// <summary>
    /// 退款查询请求
    /// </summary>
    public class RefundQueryRequest
    {
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 审核状态 (0=待审核, 1=审核通过, 2=审核失败)
        /// </summary>
        public int? AuditStatus { get; set; }

        /// <summary>
        /// 患者ID（可选）
        /// </summary>
        public string? PatientId { get; set; }

        /// <summary>
        /// 患者姓名（可选）
        /// </summary>
        public string? PatientName { get; set; }

        /// <summary>
        /// 页码（默认1）
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小（默认20）
        /// </summary>
        public int PageSize { get; set; } = 20;

        /// <summary>
        /// 默认查询天数（当没有指定日期范围时使用，默认30天）
        /// </summary>
        public int DefaultDays { get; set; } = 30;
    }

    /// <summary>
    /// 退款查询响应
    /// </summary>
    public class RefundQueryResponse
    {
        /// <summary>
        /// 数据列表
        /// </summary>
        public IEnumerable<RefundResponse> Data { get; set; } = new List<RefundResponse>();

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; }
    }

    /// <summary>
    /// ID请求
    /// </summary>
    public class IdRequest
    {
        public long Id { get; set; }
    }

    /// <summary>
    /// 用户名请求
    /// </summary>
    public class UsernameRequest
    {
        public string Username { get; set; } = string.Empty;
    }

    /// <summary>
    /// 患者ID请求
    /// </summary>
    public class PatientIdRequest
    {
        public string PatientId { get; set; } = string.Empty;
    }

    /// <summary>
    /// 主表ID请求
    /// </summary>
    public class MasterIdRequest
    {
        public long MasterId { get; set; }
    }

    /// <summary>
    /// 联系时间更新请求
    /// </summary>
    public class ContactUpdateRequest
    {
        public long Id { get; set; }
        public DateTime ContactTime { get; set; }
    }

    /// <summary>
    /// 退费任务主表更新请求
    /// </summary>
    public class RefundTaskMasterUpdateRequest
    {
        public long Id { get; set; }
        public string? Username { get; set; }
        public string? Fullname { get; set; }
        public int? AccountCount { get; set; }
        public decimal? AccountSumBalance { get; set; }
    }
}